{{define "layout"}}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    {{if .Config.GoogleAnalyticsId}}
    <!-- Google tag (gtag.js) -->
    <script{{.Nonce}} async src="https://www.googletagmanager.com/gtag/js?id={{.Config.GoogleAnalyticsId}}"></script>
    <script{{.Nonce}}>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', '{{.Config.GoogleAnalyticsId}}');
    </script>
    {{end}}
    <title>{{.Title}}</title>
    {{linkTag .Nonce "shortcut icon" "/assets/img/favicon.ico" .AssetHashes}}
    {{linkTag .Nonce "stylesheet" "/assets/3d/bootstrap.min.css" .AssetHashes}}
    {{linkTag .Nonce "stylesheet" "/assets/css/codesearch.css" .AssetHashes}}
    <script{{.Nonce}} src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
    <script{{.Nonce}} src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.1/underscore-min.js" integrity="sha256-Qtj60TvCj8cmd1GW7Jq5U/6/m94XXFhFEoNhyVP6F/Q=" crossorigin="anonymous"></script>
    <script{{.Nonce}} src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js" integrity="sha256-tQjdUhE0MTzHcOzRUuotgnMrURWIamfdqwv1QWB57uk=" crossorigin="anonymous"></script>
    <script{{.Nonce}} src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
    <script{{.Nonce}} src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/js/bootstrap-select.min.js" integrity="sha256-19J3rT3tQdidgtqqdQ3xNu++Gd7EoP/ag/0x1lHi0xY=" crossorigin="anonymous"></script>
    <link{{.Nonce}} rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.4/css/bootstrap-select.min.css" integrity="sha256-/us3egi2cVp0mEkVR8cnqLsuDY6BmrDuvTPUuEr1HJQ=" crossorigin="anonymous" />
    <script{{.Nonce}} src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.1.4/js.cookie.min.js" integrity="sha256-NjbogQqosWgor0UBdCURR5dzcvAgHnfUZMcZ8RCwkk8=" crossorigin="anonymous"></script>
    {{if .ScriptData}}
    <script id="scriptDataJson" type="application/json">{{.ScriptData}}</script>
    <script{{.Nonce}}>
      window.scriptData = JSON.parse(document.getElementById('scriptDataJson').textContent);
    </script>
    {{end}}
    {{if .ScriptName}}
    <script{{.Nonce}}>
      window.page = {{.ScriptName}};
    </script>
    {{end}}
    {{scriptTag .Nonce "/assets/js/bundle.js" .AssetHashes}}
    {{if .Config.Sentry.URI}}
    <script{{.Nonce}} src="//cdn.ravenjs.com/1.1.15/jquery,native/raven.min.js"></script>
    <script{{.Nonce}}>
      Raven.config({{.Config.Sentry.URI}}, {}).install();
    </script>
    {{end}}
    <link{{.Nonce}} rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Code Search" />
  </head>
  <body>
    {{if .IncludeHeader}}
    <div id='header'>
      {{if .Config.HeaderHTML}}
        {{.Config.HeaderHTML}}
      {{else}}
        <ul>
          <li><a href="/">search</a></li>
          <li><a href="/about">about</a></li>
          <li><a href="https://github.com/livegrep/livegrep">source</a></li>
          {{if .Config.Feedback.MailTo}}
          <li><a id='feedbacklink' href="mailto:{{.Config.Feedback.MailTo}}">feedback</a></li>
          {{end}}
          <li class='first'>livegrep is a project by <a href="http://blog.nelhage.com/">Nelson Elhage</a></li>
        </ul>
      {{end}}
    </div>
    {{end}}
    {{block "body" .}}{{end}}
    {{if .Config.FooterHTML}}
      {{.Config.FooterHTML}}
    {{end}}
  </body>
</html>
{{end}}
